import App from './App'
import $http from '@/utils/request.js'
import { createPinia } from 'pinia'
// pinia持久化
import persist from 'pinia-plugin-persistedstate'
const pinia = createPinia()
pinia.use(persist)

uni.$http = $http

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'

export function createApp() {
  const app = createSSRApp(App)
  app.use(pinia)
  return {
    app,
    pinia
  }
}
// #endif